package com.youtui.manager.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.youtui.common.constant.ResultMessage;
import com.youtui.common.util.ResultUtil;
import com.youtui.manager.model.Account;
import com.youtui.manager.service.IAccountService;

@Controller
@RequestMapping("account")
public class AccountController extends BaseController {

	@Autowired IAccountService accountService;
	
	
	@RequestMapping("/load.do")
	@ResponseBody
	public ResultMessage loadAccount(Long devId){
		if(devId == null){
			return ResultUtil.result(ResultUtil.code_fail, "请求参数错误");
		}
		
		Account account= accountService.findAccountByDevId(devId);
		
		if(account != null){
			return ResultUtil.result(ResultUtil.code_success, "开发者账户信息" , account);
		}
		return ResultUtil.result(ResultUtil.code_fail, "开发者账户信息不存在");
	}
	 
	
}
